package com.puti.doctor.service.impl;

import java.util.List;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.puti.doctor.domain.vo.DoctorPatientVo;
import com.puti.doctor.domain.vo.DoctorRecordVo;
import com.puti.doctor.domain.vo.PatientRecordVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.puti.doctor.mapper.DoctorPatientRecordMapper;
import com.puti.doctor.domain.DoctorPatientRecord;
import com.puti.doctor.service.IDoctorPatientRecordService;

/**
 * 医生-患者-记录 医生-患者-记录Service业务层处理
 * 
 * @author puti
 * @date 2021-04-22
 */
@Service
public class DoctorPatientRecordServiceImpl implements IDoctorPatientRecordService 
{
    @Autowired
    private DoctorPatientRecordMapper doctorPatientRecordMapper;

    /**
     * 查询医生-患者-记录 医生-患者-记录
     * 
     * @param recordId 医生-患者-记录 医生-患者-记录ID
     * @return 医生-患者-记录 医生-患者-记录
     */
    @Override
    public DoctorPatientRecord selectDoctorPatientRecordById(Long recordId)
    {
        return doctorPatientRecordMapper.selectDoctorPatientRecordById(recordId);
    }

    /**
     * 查询医生-患者-记录 医生-患者-记录列表
     * 
     * @param doctorPatientRecord 医生-患者-记录 医生-患者-记录
     * @return 医生-患者-记录 医生-患者-记录
     */
    @Override
    public List<DoctorPatientRecord> selectDoctorPatientRecordList(DoctorPatientRecord doctorPatientRecord)
    {
        return doctorPatientRecordMapper.selectDoctorPatientRecordList(doctorPatientRecord);
    }

    @Override
    public Page selectRecordList(Long recordDoctorId,int page,int pageSize) {
        PageHelper.startPage(page,pageSize);
        return (Page) doctorPatientRecordMapper.selectRecordList(recordDoctorId);
    }

    /**
     * 新增医生-患者-记录 医生-患者-记录
     * 
     * @param doctorPatientRecord 医生-患者-记录 医生-患者-记录
     * @return 结果
     */
    @Override
    public int insertDoctorPatientRecord(DoctorPatientRecord doctorPatientRecord)
    {
        return doctorPatientRecordMapper.insertDoctorPatientRecord(doctorPatientRecord);
    }

    /**
     * 修改医生-患者-记录 医生-患者-记录
     * 
     * @param doctorPatientRecord 医生-患者-记录 医生-患者-记录
     * @return 结果
     */
    @Override
    public int updateDoctorPatientRecord(DoctorPatientRecord doctorPatientRecord)
    {
        return doctorPatientRecordMapper.updateDoctorPatientRecord(doctorPatientRecord);
    }

    /**
     * 批量删除医生-患者-记录 医生-患者-记录
     * 
     * @param recordIds 需要删除的医生-患者-记录 医生-患者-记录ID
     * @return 结果
     */
    @Override
    public int deleteDoctorPatientRecordByIds(Long[] recordIds)
    {
        return doctorPatientRecordMapper.deleteDoctorPatientRecordByIds(recordIds);
    }

    /**
     * 删除医生-患者-记录 医生-患者-记录信息
     * 
     * @param recordId 医生-患者-记录 医生-患者-记录ID
     * @return 结果
     */
    @Override
    public int deleteDoctorPatientRecordById(Long recordId)
    {
        return doctorPatientRecordMapper.deleteDoctorPatientRecordById(recordId);
    }

    @Override
    public Page selectRecord(Long recordDoctorId,int page,int pageSize) {
        PageHelper.startPage(page,pageSize);
        return (Page) doctorPatientRecordMapper.selectRecord(recordDoctorId);
    }

    @Override
    public Page findByDoctor(Long recordDoctorId,String patientName,String startTime,String endTime,int page,int pageSize) {
        PageHelper.startPage(page,pageSize);
        return (Page) doctorPatientRecordMapper.findByDoctor(recordDoctorId,patientName,startTime,endTime);
    }

    @Override
    public Page findPatentDoctorId(Long recordDoctorId, String dateTime,int page,int pageSize) {
        PageHelper.startPage(page,pageSize);
        return (Page) doctorPatientRecordMapper.findPatentDoctorId(recordDoctorId,dateTime);
    }
}
